//
//  RecomendCollectionViewCellThree.m
//  JZMCFM
//
//  Created by zhangxin.com on 15/11/2.
//  Copyright (c) 2015年 陈卓. All rights reserved.
//

#import "RecomendCollectionViewCellThree.h"

@implementation RecomendCollectionViewCellThree

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self  setthreeCell];
    }
    return self;
}

- (void)setthreeCell
{
    self.triangimage = [[UIImageView alloc]initWithFrame:CGRectMake(10, 5, kscreenwidth/20, 0)];
    self.triangimage.image = [UIImage imageNamed:@"iconfont-sanjiaoyou"];
    [self addSubview:self.triangimage];
    self.titleLable = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.triangimage.frame), self.triangimage.frame.origin.y, kscreenwidth/3*2, self.triangimage.frame.size.height)];
    [self addSubview:self.titleLable];
    
//    self.moreButton = [UIButton buttonWithType:UIButtonTypeSystem];
//    self.moreButton.frame = CGRectMake(CGRectGetMaxX(self.titleLable.frame), self.triangimage.frame.origin.y, kscreenwidth/3, self.triangimage.frame.size.height);
//    [self.moreButton setTitle:@"更多" forState:UIControlStateNormal];
//    [self.moreButton setTintColor:[UIColor orangeColor]];
//    [self addSubview:self.moreButton];
    
    
//    self.picbutton = [UIButton buttonWithType:UIButtonTypeSystem];
//    self.picbutton.frame = CGRectMake(self.triangimage.frame.origin.x,CGRectGetMaxY(self.triangimage.frame), kscreenwidth/5, kscreenwidth/5);
//    [self addSubview:self.picbutton];
    
    self.picImage =[[UIImageView alloc]initWithFrame:CGRectMake(self.triangimage.frame.origin.x, CGRectGetMaxY(self.triangimage.frame), kscreenwidth/5, kscreenwidth/5)];
    [self.contentView addSubview:self.picImage];
    
    self.titleLable = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.picImage.frame)+3, self.picImage.frame.origin.y, kscreenwidth/5*4, kscreenwidth/5/4*1)];
    [self addSubview:self.titleLable];
    
    self.subtit = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.picImage.frame)+3, CGRectGetMaxY(self.titleLable.frame), kscreenwidth/5*4, kscreenwidth/5/4*3)];
    [self addSubview:self.subtit];
    
}

- (void)setcellDataModel:(RecommedModel *)model
{
    [self.picImage sd_setImageWithURL:[NSURL URLWithString:model.coverPath]];
    self.titleLable.text = model.title;
    self.subtit.text = model.subtitle;
    self.subtit.font = [UIFont systemFontOfSize:14];
    
}
@end
